import { MarkerType, Position } from '@vue-flow/core'
import { presets } from './nodes/presets.js'


export const initialNodes = [
  { id: '1', type: 'input', label: 'Node 1', position: { x: 250, y: 0 }, class: 'light' },
  { id: '2', type: 'output', label: 'Node 2', position: { x: 100, y: 100 }, class: 'light' },
  { id: '3', label: 'Node 3', position: { x: 400, y: 100 }, class: 'light' },
  { id: '4', label: 'Node 4', position: { x: 150, y: 200 }, class: 'light' },
  { id: '5', type: 'output', label: 'Node 5', position: { x: 300, y: 300 }, class: 'light' },
  {
    id: '11',
    type: 'input',
    label: '双击我',
    position: { x: 0, y: 0 },
    sourcePosition: Position.Right,
  },
  {
    id: '12',
    type: 'output',
    label: '双击我',
    position: { x: 1000, y: 1000 },
    targetPosition: Position.Left,
  },
  {
    id: '21',
    type: 'color-selector',
    data: { color: presets.ayame },
    position: { x: 0, y: 50 },
  },
  {
    id: '22',
    type: 'output',
    position: { x: 350, y: 114 },
    targetPosition: Position.Left,
  },
]

// const colorSelectorData = toRef(() => initialNodes.value[0].data)

export const initialEdges = [
  { id: 'e1-2', source: '1', target: '2', animated: true },
  { id: 'e1-3', label: 'edge with arrowhead', source: '1', animated: true, target: '3', markerEnd: MarkerType.ArrowClosed },
  {
    id: 'e4-5',
    type: 'step',
    label: 'step-edge',
    source: '4',
    target: '5',
    animated: true, 
    style: { stroke: 'orange' },
    labelBgStyle: { fill: 'orange' },
  },
  { id: 'e3-4', type: 'smoothstep', label: 'smoothstep-edge', source: '3', target: '4',animated: true },
  { id: 'e11-2', type: 'custom', source: '11', target: '12', animated: true, style: { stroke: '#000' } },
  {
    id: 'e1a-2',
    source: '21',
    sourceHandle: 'a',
    target: '22',
    animated: true,
    style: () => ({
      stroke: presets.ayame,
    }),
  },
]
